﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ctem.gui.WrappedGraphLib.Test
{
    public class Vertex : GraphLib.IVertex
    {
        private string m_name;
        private WrappedGraphLib.WrappedGraph m_graph;
        public int deg;
        //private int m_SortNum;
        private double m_weight;

        //public int SortNum { get { return m_SortNum; } set { m_SortNum = value; } }

        //public void SetGraph(GraphLib.Graph graph)
       // {
       //     m_graph = graph as WrappedGraphLib.WrappedGraph;
       // }

        public double Weight
        {
            get { return m_weight; }
            set { m_weight = value; }
        }

        public string GetName()
        {
            return m_name;
        }

        public Vertex(string _name)
        {
            m_name = _name;
        }
    }

    class Program
    {
        static WrappedGraphLib.WrappedGraph graph = new WrappedGraph();
        static void Main(string[] args)
        {
            // добавление вершин
            for (int i = 0; i <= 4; i++)
                graph.AddVertex(new Vertex(i.ToString()), graph);
            // выполн соединение вершин (имя старт. верш, имя финиш. верш, имя связи)
            graph.Connect("1", "2", "link12");
            graph.Connect("2", "3", "link23");
            graph.Connect("3", "4", "link34");
            graph.Connect("4", "1", "link41");

            List<GraphLib.IVertex> lst = graph.EulerCycl("1");
            foreach (GraphLib.IVertex v in lst)
                Console.WriteLine(v.GetName());
            Console.ReadLine();
        }
    }
}
